﻿<%@ Page Language="C#" AutoEventWireup="true" 
CodeBehind="NotaSalidaInsertForm.aspx.cs" 
Inherits="UILGestion.AlmacenAdmin.NotaSalidaInsertForm" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc3" %>


<%@ Register assembly="SesarchResultLib" namespace="SesarchResultLib" tagprefix="cc1" %>
<%@ Register Assembly="SesarchResultLib" Namespace="SesarchResultLib" TagPrefix="cc2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<%--<%@ Register assembly="EstandarControl" namespace="EstandarControl" tagprefix="lib" %>--%>
<%@ Register src="~/Control/menuCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>

<%--<%@ Register assembly="SesarchResultLib" namespace="SesarchResultLib" tagprefix="cc1" %>--%>

<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/main.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/NotaSalida.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/theme.css" />
    <title>Nota Salida</title>
    <style type="text/css">
        .style1
        {
            width: 301px;
        }
    </style>







    </head>
    
    <body>
        <form id="form1" runat="server" autocomplete="off">
        <input id="idAlmacen" type="hidden"  runat="server"/>
        <input id="fechaPeriodo" type="hidden"  runat="server"/>
        <input id="idNI" type="hidden"  runat="server"/>
        
            <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
     
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true"  
                    EnablePartialRendering="true"></asp:ToolkitScriptManager>
                  
                   <asp:Panel ID="mainPanel1" runat="server" Visible="false"
                                CssClass="Heading secTitle AreaHeading ms-crm-List-Header "
                                       Width="100%"  >
      
        
                 
                 <asp:Label ID="Label1" runat="server" Text="NOTA SALIDA" 
                         style="font-size: large; color: #960818"></asp:Label>

 </asp:Panel>  

 <asp:Panel ID="PanelButtom" runat="server" Visible="false"    class="ms-crm-Form-Body" >
                          <input id="idObra" type="hidden" runat="server" />
       <input id="internalid" type="hidden" runat="server" />
       <input id="idEmpresa" type="hidden" runat="server" />
        <input id="type" type="hidden" runat="server" />
       
       <input id="idColeccionList" type="hidden" runat="server" />
        <input id="idOC" type="hidden" runat="server" />
                   <table >
<tr>

<td>
    <asp:Button ID="saveButton" runat="server" Text="Guardar"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick"     /></td>
       <td>
     <asp:Button ID="refreshButton" runat="server" Text="Restablecer"  CssClass="ms-crm-List-Header"
        onclick="btnContinue_OnClick"  /></td>

<td>
    <asp:Button ID="cancelarButton" runat="server" Text="Cancelar"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick" Width="80px" /></td>
        <td></td>
        <td>

                                   <%--okcontrolid="LinkButton3"--%>
                
                </td><td>
            

            &nbsp;</td><td>
            

            &nbsp;</td></tr></table>
  
    </asp:Panel>
                
    <asp:Panel ID="PanelBody" runat="server" Visible="false" BackColor="white" >
        
                  <table>
                      <tr>
                          <td align="right" valign="top" width="100px">
                               Fecha:</td>
                          <td valign="top" class="style1">
                         

                          
                              <cc2:Input ID="fechaEmisonTextBox" runat="server" AutoPostBack="True"  OnTextChanged="Fecha_click"
                                  Width="100px" Height="19px" />
                              <asp:ImageButton ID="ImageButton1" runat="Server" 
                                  AlternateText="Click aqui para mostrar calendario" 
                                  ImageUrl="~/Images/month.gif" Width="16px" />
                                  <asp:CalendarExtender ID="CalExt1" runat="server" PopupButtonID="ImageButton1" 
                                  TargetControlID="fechaEmisonTextBox">
                              </asp:CalendarExtender>
                           
                          </td>
                          <td align="right" valign="top" width="100px">
                               PERIODO: </td>
                          <td valign="top" width="200px" style="background-color:#FFCCFF">
                            <asp:UpdatePanel runat="server" ID="fechaup" UpdateMode="Conditional">
                          <ContentTemplate>
                                AÑO:<cc3:Input ID="anioTxt" runat="server" Width="50px" ReadOnly="true" BackColor="Transparent"></cc3:Input>
                              MES:<cc3:Input ID="mesTxt" runat="server" Width="50px" ReadOnly="true" BackColor="Transparent" ></cc3:Input>
                                 </ContentTemplate>
                          </asp:UpdatePanel>
                          </td>
                      </tr>
                      <tr>
                      <td align="right" width="100px" valign="top">
                               Numero: </td>
                          <td class="style1" valign="top">
                            
                              <asp:Label ID="numDocumentoLabel" runat="server" Text=""></asp:Label>
                          </td>
                          
                          <td align="right" valign="top" width="100px">
                               Motivo: </td>
                          <td valign="top" width="200px">
                                <asp:DropDownList ID="motivoDropDownList" runat="server" Width="250px"  AutoPostBack="true"
                                    onselectedindexchanged="motivoDropDownList_SelectedIndexChanged">
                                </asp:DropDownList>
                          </td>
                      </tr>
                      <tr>
                          <td align="right" width="100px">
                              &nbsp;</td>
                          <td class="style1">
                              &nbsp;</td>
                          <td align="right" valign="top" width="100px">
                              &nbsp;</td>
                          <td valign="top" width="250px">
                              <asp:UpdatePanel runat="server" ID="almacenUNPL" >
                              <ContentTemplate>
                              <asp:Panel ID="almacenDestinoPNL" runat="server" Width="100%">
                                  Almacen: <asp:DropDownList ID="almacenDestinoDDL" runat="server" Width="200px"></asp:DropDownList>
                              </asp:Panel>
                              </ContentTemplate>
                              <Triggers>
                              <asp:AsyncPostBackTrigger ControlID="motivoDropDownList" />
                              </Triggers>
                              </asp:UpdatePanel>
                              
                              
                             
                          </td>
                      </tr>
                      <tr>
                         <td align="right" width="100px">
                               Documento: </td>
                          <td class="style1">
                              <asp:DropDownList ID="tipoDocDropDownList" runat="server"   
                                  Width="150px">
                              </asp:DropDownList>
                              <asp:TextBox ID="documentoTextBox" runat="server"   
                                  Width="120px"></asp:TextBox>
                          </td>
                          <td align="right" valign="top">
                               Solicita:</td>
                          <td>

                              <cc2:Input ID="SolicitaEditTextBox" runat="server"  
                                  Width="300px" />

                            
                          </td>
                      </tr>
                      <tr>
                          <td align="right" width="100px">
                               
                                   <asp:Label ID="unidadTrabajoLabel" runat="server" Text="Unidad Trabajo:"></asp:Label> </td>
                          <td class="style1">
                              <asp:DropDownList ID="unitNegocioDropDownLis" runat="server"     Width="250px">
                              </asp:DropDownList>
                         

                              </td>
                          <td align="right" valign="top">
                               Autorizado:</td>
                          <td  width="450px">
                                  <cc2:Input ID="idautorizadoEditTextBox" runat="server" backcolor="#DFE8F6"      
                            ReadOnly="true" Width="30px" />

                                  <cc3:Input ID="autorizadoEditTextBox" runat="server" backcolor="#DFE8F6" 
                                      DataType="List" method="GetEmpleado"  NumColum="2"
                                      onchange="javascript:validarautorizadoEdit(this);" 
                                      OnSelect="SelectAutoizadoEdit" Width="300px" />
                                      <cc2:Input ID="autorizadoEdit1TextBox" runat="server" BackColor="Transparent"      
                            ReadOnly="true" Width="0px" />
                         

                          </td>
                      </tr>
                      <tr>
                          <td align="right" valign="top" width="100px">
                              
                               Observaciones: </td>
                          <td  colspan="3">
                              <cc1:Input ID="observacionTextBox" runat="server" TextMode="MultiLine" Width="400px"  Font-Size="Small"></cc1:Input>
                          </td>
                         
                      </tr>
                  </table>



                     <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
                      <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Insumos">
                     <ContentTemplate>



        <asp:UpdatePanel ID="ItemUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
 
              

        <asp:GridView ID="itemGridView" runat="server" 
        AutoGenerateColumns="False"
         CellPadding="4" 
          SkinID="GridView"
           
       
       
        DataKeyNames="idInternal"
        onrowcancelingedit="CancelEditItem" 
        onrowediting="EditItem" 
        onrowupdating="UpdateItem" 
        >

    <Columns>
           

      

            <asp:TemplateField HeaderText="Codigo" ItemStyle-Width="70px">
                <ItemTemplate>
            <asp:Label ID="codigoLabel" runat="server" Text='<%# Eval("codigo")%>'></asp:Label>
            </ItemTemplate>
        
         <EditItemTemplate>
            <cc2:Input ID="codigoEditTextBox" runat="server" BackColor="Transparent" 
                   ReadOnly="true" Text='<%# Eval("codigo")%>' Width="70px" />
            </EditItemTemplate>
        
             
<FooterTemplate>
<cc2:Input ID="codigoInsertTextBox" runat="server" BackColor="Transparent" 
          ReadOnly="true" Width="70px" />
          <cc2:Input ID="IdInsumoTXT" runat="server" BackColor="Transparent" 
          ReadOnly="true" Width="0px" />
            </FooterTemplate>
        
        
                                            
                                         
</asp:TemplateField>
<asp:TemplateField HeaderText="Descripcion" HeaderStyle-Width="350px">

<ItemTemplate>
    <asp:Label ID="descripcionLabel" runat="server" 
        Text='<%# Eval("descripcion")%>'></asp:Label>
            </ItemTemplate>
   
            
 <EditItemTemplate>
 
 <asp:Label ID="descripcionEditTextBox" runat="server" ReadOnly="true" 
         Text='<%# Eval("descripcion")%>' />
           </EditItemTemplate>
        
        
        
         
 <FooterTemplate>
    

   
<cc2:Input ID="descripcionInsert1TextBox" runat="server" BackColor="Transparent" 
           ReadOnly="true" Width="0"  />
 <cc3:Input ID="descripcionInsertTextBox" runat="server" DataType="List"   backcolor="#DFE8F6" 
           method="GetRecursos"        ChkVal='<%# int.Parse((string)Request.QueryString["idAlmacen"])%>' 
         OnSelect="SelectRecursoInsert"  Width="90%" />
          <%--onchange="javascript:validarRecursoInsert(this);"--%>
 </FooterTemplate>
                                           
                                         
</asp:TemplateField>


  <asp:TemplateField HeaderText="Unid.">
      <ItemTemplate>
          <asp:Label ID="unidadLabel" runat="server" Text='<%# Eval("unidad")%>' 
              Width="50"></asp:Label>
            </ItemTemplate>
        
        
        
        
        
        
        
        
        
            
      <EditItemTemplate>
          <asp:Label ID="unidadEditTextBox" runat="server" Text='<%# Eval("unidad")%>'  
              Width="50px" />
            </EditItemTemplate>
        
        
        
        
        
        
        
        
        
        
            
             
<FooterTemplate>
<cc2:Input ID="unidadInsertTextBox" runat="server" BackColor="Transparent" 
          ReadOnly="true" Width="50px" />
            </FooterTemplate>
        
        
        
        
        
        
        
        
        
        
        
                                        
</asp:TemplateField>


  <asp:TemplateField HeaderText="Cant. Orig" ItemStyle-HorizontalAlign="Right">
  <ItemTemplate>
  <asp:Label ID="cantidadOrigLabel" runat="server" BackColor="Transparent"  
          Text='<%# Eval("cantidadOrig")%>' />
            </ItemTemplate>
      
            
  <EditItemTemplate>
  <cc1:Input ID="cantidadOrigEditTextBox" runat="server"   backcolor="Transparent"  DataType="Double"
          Text='<%# Eval("cantidadOrig")%>' Width="75px"  ReadOnly="true" />   
            </EditItemTemplate>
    
            
             
<FooterTemplate>
<cc1:Input ID="cantidadOrigInsertTextBox" runat="server"  backcolor="Transparent"   ReadOnly="true"  DataType="Double"
    
  Width="75px" />
</FooterTemplate>

</asp:TemplateField>



  <asp:TemplateField HeaderText="Cant." ItemStyle-HorizontalAlign="Right">
  <ItemTemplate>
  <asp:Label ID="cantidadLabel" runat="server" BackColor="Transparent" 
          Text='<%# Eval("cantidad")%>' />
            </ItemTemplate>
      
            
  <EditItemTemplate>
  <cc1:Input ID="cantidadEditTextBox" runat="server"   backcolor="White"  DataType="Double"
          onchange="javascript:calcularCantidadDisponible(this);"
          Text='<%# Eval("cantidad")%>' Width="75px" />   
            </EditItemTemplate>
<%-- --%>
            
             
<FooterTemplate>
<cc1:Input ID="cantidadInsertTextBox" runat="server"  backcolor="White" DataType="Double" 
onchange="javascript:calcularCantidadnstDisponible(this);"
  Width="75px" />


                                       
            </FooterTemplate>
        
        
         
        
        
        
        
        
        
        
        
        
        
            
</asp:TemplateField>



 <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
            EditImageUrl="~/Images/edit.gif" ShowEditButton="True" 
            UpdateImageUrl="~/Images/update.gif" />
          
             <asp:TemplateField>
               <ItemTemplate>
 
                     <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                       CommandArgument='<%# Eval("idInternal")%>' OnClick="Deleteitem" 
                       OnClientClick="return confirm('Usted quiere eliminar?')" 
                       ImageUrl="~/Images/delete.gif"
                       />
                       <%--Text="&lt;img src=&quot;../Images/delete.gif&quot; /&gt;" --%>
                        
             </ItemTemplate>
        
        
        
            
  <FooterTemplate>
  
<asp:Button ID="btnAdd" runat="server" OnClick="AddNewItem" Text="Añadir"  > </asp:Button>
        <%--   Text="&lt;img src=&quot;../Images/up.gif&quot; /&gt;"--%>
            </FooterTemplate>
        
        
        
        
        
            
   </asp:TemplateField>
                </Columns>
        </asp:GridView>
       </ContentTemplate>
         </asp:UpdatePanel>  

         </ContentTemplate>
         </asp:TabPanel>
         </asp:TabContainer>




 </asp:Panel>



    
                              
   

    </form>
</body>
</html>
